<template>
	<view>
		<!-- 列表 -->
		<view class="relative-border">
			<view v-for="(item,index) in dataList" :key="index" :class="{'invencurrent':(currentIndex === index)}">
				<view class="invent-listcon" @click="invent(index)">
					<view class="invent-oddnumber">
						{{item.title}}
					</view>
					<view class="invent-content">
						<view>
							{{item.name}}
						</view>
						<view>
							{{item.startTime}}
						</view>
						<view>
							{{item.number}}
						</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 按钮 -->
		<view class="flexinven-button">
			<u-row gutter="16" class="flexinven-con">
				<u-col span="3">
					<view class="flexinven-flex">获取任务</view>
				</u-col>
				<u-col span="3">
					<view class="flexinven-flex" @click="view">查看</view>
				</u-col>
				<u-col span="3">
					<view class="flexinven-flex">上传</view>
				</u-col>
				<u-col span="3">
					<view class="flexinven-flex">删除</view>
				</u-col>
			</u-row>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: false,
				currentIndex: null,
				dataList: [{
					title: '1单据号 : ZCPD201903220001',
					name: '任务名称:',
					startTime: '单据日期:2019-03-22 17:22:32',
					number: '设备总数:2已检 设备数:0未检设备数:2'
				}, {
					title: '2单据号 : ZCPD201903220001',
					name: '任务名称:',
					startTime: '单据日期:2019-03-22 17:22:32',
					number: '设备总数:2已检 设备数:1未检设备数:1'
				}]
			}
		},
		methods: {
			// table栏
			invent(index) {
				this.currentIndex = index
			},
			// 查看
			view() {
				uni.navigateTo({
					url: 'pages/eam/Equipment/EquipmentList/Inspection'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.inven-border:last-child {
		border-bottom: 0;
	}

	.invencurrent {
		background-color: #f3f2f5;
	}
</style>
